import request from '@/utils/request'
import request2 from '@/utils/request2'
import { WrText, Text } from './type'

// 项目讯飞文本相关的请求地址
enum API {
  REWRITE_URL = '/rewrite',
  TEXTCORRECTION_URL = '/textCorrection',
  CREATEIMG_URL = '/create',
}

// 文本改写
export const reqRewrite = (data: WrText) => request.get<any, any>(API.REWRITE_URL, { params: data })

// 文本纠错
export const reqTextCorrection = (data: Text) =>
  request.get<any, any>(API.TEXTCORRECTION_URL, { params: data })

// 生成图片
export const reqCreateImg = (data: any) =>
  request2.get<any, any>(API.CREATEIMG_URL, { params: data })
